package private1;

public class DayComparator3 {
    //作为参数的类类型变量
    static boolean compDay(Day d1,Day d2){
        return d1.getYear()==d2.getYear()&&
                d1.getMonth()==d2.getMonth()&&
                d1.getDate()==d2.getDate();
    }


    public static void main(String[] args) {
        Day day1=new Day(1997,4,20);
        System.out.println("day1="+day1);
        Day day2=new Day(day1);//将day1的所有字段复制到day2中
//构建与某个日期相同的实例
        System.out.println("day2="+day2);

        if (day1.equalTo(day2))
            System.out.println("相等");
        else
            System.out.println("不相等");

        Day day3=new Day();
        day3.set(1856,2,5);

        Day d1=new Day();
        Day d2=new Day(2010);
        Day d3=new Day(2010,10);
        System.out.println(d1);
        System.out.println(d2);
        System.out.println(d3);


        //Day day2=new Day(1997,5,12);


    }
}
